﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WMSNet.Data
{
    public class DatabaseFactory : Disposable, IDatabaseFactory
    {
        private WMSNetEntities dataContext;
     
        public WMSNetEntities Get()
        {
            return dataContext ?? (dataContext = new WMSNetEntities());
        }
        public DatabaseFactory()
        {
            
        }
        protected override void DisposeCore()
        {
            if (dataContext != null)
                dataContext.Dispose();
        }
    }
}
